﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WF.Common;

namespace WF.Web.Classes
{
    public partial class ErrorPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Request["aspxerrorpath"] != null)
            //{
            //}
            //else
            //{
            //}

            //从Session中取出LastErrotMessage,输出到页面

            if ((null != Session) && (null != Session[SessionKeys.LastErrotMessage]))
            {
                Exception ex = (Exception)Session[SessionKeys.LastErrotMessage];


                this.lblMessage.Text = ex.Message;
                this.lblDetailMessage.Text = ex.ToString();
                Session[SessionKeys.LastErrotMessage] = null;
            }
        }

        protected void btnDetail_Click(object sender, EventArgs e)
        {
            this.lblDetailMessage.Visible = !this.lblDetailMessage.Visible;
        }

        protected void btnClose_Click(object sender, EventArgs e)
        {

        }

        protected void btnGoHome_Click(object sender, EventArgs e)
        {
            this.Page.Response.Redirect("Default.aspx");
            //this.Page.Server.TransferRequest("~/MainForm.aspx");
        }
    }
}